package com.example.tests;

//import static org.hamcrest.MatcherAssert.*;
//import static org.hamcrest.Matchers.*;
//import static org.junit.Assert.*;

//import static org.hamcrest.MatcherAssert.*;
//import static org.hamcrest.Matchers.*;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;

import org.testng.annotations.Test;

import com.example.fw.GroupObject;
import com.example.fw.Groups;

import java.util.logging.Logger;

public class GroupCreationTest extends TestBase {
	
	private Logger log = Logger.getLogger("GroupCreationTest");
	
	@Test(dataProvider = "groupsFromFile", dataProviderClass = GroupDataGenerator.class)
	public void testValidGroupCanBeCreated(GroupObject validGroup) throws Exception {
		Groups oldList = app.getHibernateHelper().getGroups();
		//Groups oldList = app.getGroupHelper().getGroups();
		app.getGroupHelper().createGroup(validGroup);
		Groups newList = app.getGroupHelper().getGroups();
		//verifyGroupAdded(oldList, validGroup, newList);
		assertThat(newList, equalTo(oldList.withAdded(validGroup)));
	}
}
